package Colecciones;

import Modelo.EjecutaConsulta;
import java.io.PrintStream;
import java.util.Vector;

public class datosEstudiantes
{
  public static Vector getProgramas(String p_emplid)
  {
    Vector datos = new Vector();
    try
    {
      String consulta = " SELECT AP.ACAD_PROG CODIGO, P.DESCR DESCR FROM PS_ACAD_PROG AP, PS_ACAD_PROG_TBL P WHERE AP.ACAD_PROG = P.ACAD_PROG AND AP.EMPLID = '" + p_emplid + "'" + " AND AP.PROG_ACTION = 'MATR'" + " AND NOT EXISTS (SELECT 'x' FROM PS_ACAD_PROG AP1" + "                 WHERE AP1.EMPLID = AP.EMPLID" + "                 AND AP1.ACAD_CAREER = AP.ACAD_CAREER" + "                 AND AP1.ACAD_PROG = AP.ACAD_PROG" + "                 AND AP1.STDNT_CAR_NBR = AP.STDNT_CAR_NBR" + "                 AND AP1.PROG_ACTION ='COMP')" + " AND P.EFFDT = (SELECT MAX(P1.EFFDT)" + "               FROM PS_ACAD_PROG_TBL P1" + "               WHERE P.INSTITUTION = P1.INSTITUTION" + "               AND P.ACAD_CAREER = P1.ACAD_CAREER" + "               AND P.ACAD_PROG = P1.ACAD_PROG" + "               AND P1.EFFDT <= SYSDATE)";

      datos = EjecutaConsulta.Ejecutar(consulta);
    } catch (Exception e) {
      System.out.println("Error: en la consulta de datosEstudiantes.getProgramas " + e.toString());
    }

    return datos;
  }

  public static void main(String[] args)
  {
    Modelo.Path.ruta = "..\\WEB-INF\\classes";
    try
    {
      System.out.println(datosPersonales.getDatosPersona("0014414"));
      System.out.println(datosPersonales.getDirecciones("0014414"));
      System.out.println(datosPersonales.getEmailPreferido("0014414"));
      System.out.println(datosPersonales.getDocumentoActual("0014414"));
      System.out.println(datosPersonales.getEmplidByDocumento("16796985"));
    } catch (Exception e) {
      System.out.println("errro " + e.getMessage());
    }
  }
}